import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsOptional } from 'class-validator';

/** 创建会话dto */
export class CreateSessionDto {
  @ApiProperty({ description: '用户id' })
  @IsNotEmpty({ message: '用户id不能为空' })
  userId: number;

  @ApiProperty({ description: '会话名称' })
  @IsOptional()
  name: string;
}

/** 创建消息dto */
export class CreateMessageDto {
  @ApiProperty({ description: '问题' })
  @IsNotEmpty({ message: '输入不能为空' })
  question: string;

  @ApiProperty({ description: '回答' })
  @IsNotEmpty({ message: '输出不能为空' })
  answer: string;

  @ApiProperty({ description: '回答' })
  @IsNotEmpty({ message: '会话id不能为空' })
  sessionId: string;
}
